<template>
  <div>
    <el-form :inline="true" :model="searchParams" class="demo-form-inline">
      <el-form-item label="关键字">
        <el-input v-model="searchParams.keyWords" placeholder="输入分类关键字" />
      </el-form-item>
      <el-form-item>
        <el-date-picker
          v-model="searchParams.rangeDate"
          type="daterange"
          range-separator="至"
          start-placeholder="开始时间"
          end-placeholder="结束时间"
          format="YYYY/MM/DD"
          value-format="YYYY-MM-DD"
          size="small"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSearch">搜索</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  data () {
    return {
      searchParams: {
        keyWords: '',
        rangeDate: []
      }
    }
  },
  methods: {
    onSearch () {
      // 触发自定义事件
      this.$emit('onSearch', this.searchParams)
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
